﻿<aero:GlassWindow x:Name="GlassWindow" x:Class="vBridge.Wpf.Demo.MainWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:aero="clr-namespace:vBridge.Wpf.Aero;assembly=vBridge"
                  Title="vBridge Demo" Height="516" Width="519"
                  MinWidth="340" MinHeight="355"
                  OriginalBackground="CornflowerBlue"
                  Background="CornflowerBlue"
                  DataContext="{Binding Mode=OneWay, RelativeSource={RelativeSource Self}}">
    <Border VerticalAlignment="Center" HorizontalAlignment="Center" CornerRadius="5" Background="#33FFFFFF"
            Padding="10">
        <TabControl Background="#4CFFFFFF">
            <TabItem Header="Aero" ToolTip="Illustrates aero-glassing functionality.">
                <Grid MinHeight="300" MinWidth="300">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <GroupBox Header="Assign">
                        <UniformGrid Rows="1">
                            <Button Content="Full Glass" Click="OnFullGlassButtonClick" />
                            <Button Content="Normal" Click="OnNormalGlassButtonClick" />
                            <Button Content="Random" Click="OnRandomGlassButtonClick" />
                        </UniformGrid>
                    </GroupBox>
                    <GroupBox Header="Modify" Grid.Row="1">
                        <Grid>
                            <Grid.Resources>
                                <ResourceDictionary>
                                    <Style TargetType="{x:Type Slider}">
                                        <Setter Property="VerticalAlignment" Value="Center" />
                                        <Setter Property="Minimum" Value="-1" />
                                        <Setter Property="Maximum" Value="500" />
                                    </Style>
                                    <Style TargetType="{x:Type TextBlock}">
                                        <Setter Property="VerticalAlignment" Value="Center" />
                                        <Setter Property="FontFamily" Value="Meiryo UI" />
                                        <Setter Property="FontSize" Value="15" />
                                    </Style>
                                </ResourceDictionary>
                            </Grid.Resources>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Row="0" Grid.Column="0" Text="Left: " />
                            <TextBlock Grid.Row="1" Grid.Column="0" Text="Top: " />
                            <TextBlock Grid.Row="2" Grid.Column="0" Text="Right: " />
                            <TextBlock Grid.Row="3" Grid.Column="0" Text="Bottom: " />
                            <Slider x:Name="LeftSlider" Grid.Column="1" Grid.Row="0"
                                    Value="{Binding AeroMargins.Left, Mode=TwoWay, PresentationTraceSources.TraceLevel=High}" />
                            <Slider x:Name="TopSlider" Grid.Column="1" Grid.Row="1"
                                    Value="{Binding AeroMargins.Top, Mode=TwoWay}" />
                            <Slider x:Name="RightSlider" Grid.Column="1" Grid.Row="2"
                                    Value="{Binding AeroMargins.Right, Mode=TwoWay}" />
                            <Slider x:Name="BottomSlider" Grid.Column="1" Grid.Row="3"
                                    Value="{Binding AeroMargins.Bottom, Mode=TwoWay}" />
                            <TextBlock Grid.Column="2" Grid.Row="0"
                                       Text="{Binding AeroMargins.Left, ElementName=GlassWindow}" />
                            <TextBlock Grid.Column="2" Grid.Row="1"
                                       Text="{Binding AeroMargins.Top, ElementName=GlassWindow}" />
                            <TextBlock Grid.Column="2" Grid.Row="2"
                                       Text="{Binding AeroMargins.Right, ElementName=GlassWindow}" />
                            <TextBlock Grid.Column="2" Grid.Row="3"
                                       Text="{Binding AeroMargins.Bottom, ElementName=GlassWindow}" />
                        </Grid>
                    </GroupBox>
                </Grid>
            </TabItem>
            <TabItem Header="Bitmap" ToolTip="Illustrates RelayCommand, and BitmapToBitmapSourceValueConverter.">
                <DockPanel>
                    <Button DockPanel.Dock="Top" Content="Load Image" Command="{Binding BrowseBitmap}" />
                    <Image Source="{Binding Bitmap, Converter={StaticResource BitmapConverter}}" />
                </DockPanel>
            </TabItem>
            <TabItem Header="Beeper" ToolTip="Illustrates RelayCommandAsync.">
                <DockPanel Margin="10">
                    <CheckBox x:Name="AsyncToggle" Content="Async" IsChecked="True" DockPanel.Dock="Bottom"
                              HorizontalAlignment="Center" Checked="AsyncToggleOnChecked"
                              Unchecked="AsyncToggleOnUnchecked" />
                    <Button Content="Beep!" DockPanel.Dock="Bottom" Margin="5"
                            CommandParameter="{Binding Value, ElementName=Slider}" Command="{Binding BeepCommand}" />
                    <DockPanel>
                        <TextBox DockPanel.Dock="Right" IsReadOnly="True" Text="{Binding Value, ElementName=Slider}"
                                 MinWidth="30" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                        <Slider x:Name="Slider" IsSnapToTickEnabled="True" MinWidth="150" Minimum="37" Maximum="32767"
                                LargeChange="1000" SmallChange="200" Value="1000" />
                    </DockPanel>
                </DockPanel>
            </TabItem>
        </TabControl>
    </Border>
</aero:GlassWindow>